# test for TSNE
import json
import argparse
import h5py
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import random

h_f = h5py.File('./ucm/glove_50txt_feature_train_pca.h5')
data = h_f['data'][:]
h_f.close()

def rand_int():
  return random.randint(1,10)

labels = np.zeros(len(data),)
for i in range(len(labels)):
  labels[i] = rand_int()

X_embedded = TSNE(n_components=2).fit_transform(data)

plt.figure()
plt.scatter(X_embedded[:,0],X_embedded[:,1],c=labels, s=0.5, alpha = 0.5)
plt.show()

'''
plt.figure()
plt.plot(X_embedded[:,0],X_embedded[:,1])
plt.show()
'''